export function cacheIt(fn: Function) {
    const cache = new Map<string, any>();

    return function (...args: any[]) {
        const key = JSON.stringify(args);
        if (!cache.has(key)) {
            const result = fn.apply(null, args);
            cache.set(key, result);
            return result;
        }
        return cache.get(key);
    }
}